wait_timeout = "5"
pb_cmd = [
    {
        "cmd": 'AT+CPBS=SM',
        "match": 'AT\+CPBS=SM\s{4}\+CPBS: "SM",\d+,\d+\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBS?',
        "match": 'AT\+CPBS\?\s{4}\+CPBS: "SM",\d+,\d+\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBS=?',
        "match": 'AT\+CPBS=\?\s{4}\+CPBS: \("\w+","\w+","\w+","\w+","\w+"\)\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=?',
        "match": 'AT\+CPBW=\?\s{4}\+CPBW: \(\d-\d+\),\d+,\(\d+,\d+,\d+\),\d+\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=1,1,129,1',
        "match": 'AT\+CPBW=1,1,129,1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=2,12345678901234567890,129,12345678901234',
        "match": 'AT\+CPBW=2,12345678901234567890,129,12345678901234\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=3,1234567890,129,1234567',
        "match": 'AT\+CPBW=3,1234567890,129,1234567\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=4,15012345678,129,AAAAAAAAAAAAAA',
        "match": 'AT\+CPBW=4,15012345678,129,AAAAAAAAAAAAAA\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=5,13812345678,129,ABC',
        "match": 'AT\+CPBW=5,13812345678,129,ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=6,18012345678,129,abc',
        "match": 'AT\+CPBW=6,18012345678,129,abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=7,666666,129,1A#',
        "match": 'AT\+CPBW=7,666666,129,1A#\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=8,88888888,129,1abc',
        "match": 'AT\+CPBW=8,88888888,129,1abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=9,00000000,129,1_a',
        "match": 'AT\+CPBW=9,00000000,129,1_a\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=10,11111111,129,#ABC',
        "match": 'AT\+CPBW=10,11111111,129,#ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=11,1,129,1',
        "match": 'AT\+CPBW=11,1,129,1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=12,12345678901234567890,129,12345678901234',
        "match": 'AT\+CPBW=12,12345678901234567890,129,12345678901234\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=13,1234567890,129,1234567',
        "match": 'AT\+CPBW=13,1234567890,129,1234567\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=14,15012345678,129,AAAAAAAAAAAAAA',
        "match": 'AT\+CPBW=14,15012345678,129,AAAAAAAAAAAAAA\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=15,13812345678,129,ABC',
        "match": 'AT\+CPBW=15,13812345678,129,ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=16,18012345678,129,abc',
        "match": 'AT\+CPBW=16,18012345678,129,abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=17,666666,129,1A#',
        "match": 'AT\+CPBW=17,666666,129,1A#\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=18,88888888,129,1abc',
        "match": 'AT\+CPBW=18,88888888,129,1abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=19,00000000,129,1_a',
        "match": 'AT\+CPBW=19,00000000,129,1_a\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=20,11111111,129,#ABC',
        "match": 'AT\+CPBW=20,11111111,129,#ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=21,1,129,1',
        "match": 'AT\+CPBW=21,1,129,1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=22,12345678901234567890,129,12345678901234',
        "match": 'AT\+CPBW=22,12345678901234567890,129,12345678901234\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=23,1234567890,129,1234567',
        "match": 'AT\+CPBW=23,1234567890,129,1234567\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=24,15012345678,129,AAAAAAAAAAAAAA',
        "match": 'AT\+CPBW=24,15012345678,129,AAAAAAAAAAAAAA\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=25,13812345678,129,ABC',
        "match": 'AT\+CPBW=25,13812345678,129,ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=26,18012345678,129,abc',
        "match": 'AT\+CPBW=26,18012345678,129,abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=27,666666,129,1A#',
        "match": 'AT\+CPBW=27,666666,129,1A#\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=28,88888888,129,1abc',
        "match": 'AT\+CPBW=28,88888888,129,1abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=29,00000000,129,1_a',
        "match": 'AT\+CPBW=29,00000000,129,1_a\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=30,11111111,129,#ABC',
        "match": 'AT\+CPBW=30,11111111,129,#ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=31,1,129,1',
        "match": 'AT\+CPBW=31,1,129,1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=32,12345678901234567890,129,12345678901234',
        "match": 'AT\+CPBW=32,12345678901234567890,129,12345678901234\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=33,1234567890,129,1234567',
        "match": 'AT\+CPBW=33,1234567890,129,1234567\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=34,15012345678,129,AAAAAAAAAAAAAA',
        "match": 'AT\+CPBW=34,15012345678,129,AAAAAAAAAAAAAA\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=35,13812345678,129,ABC',
        "match": 'AT\+CPBW=35,13812345678,129,ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=36,18012345678,129,abc',
        "match": 'AT\+CPBW=36,18012345678,129,abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=37,666666,129,1A#',
        "match": 'AT\+CPBW=37,666666,129,1A#\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=38,88888888,129,1abc',
        "match": 'AT\+CPBW=38,88888888,129,1abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=39,00000000,129,1_a',
        "match": 'AT\+CPBW=39,00000000,129,1_a\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=40,11111111,129,#ABC',
        "match": 'AT\+CPBW=40,11111111,129,#ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=41,1,129,1',
        "match": 'AT\+CPBW=41,1,129,1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=42,12345678901234567890,129,12345678901234',
        "match": 'AT\+CPBW=42,12345678901234567890,129,12345678901234\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=43,1234567890,129,1234567',
        "match": 'AT\+CPBW=43,1234567890,129,1234567\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=44,15012345678,129,AAAAAAAAAAAAAA',
        "match": 'AT\+CPBW=44,15012345678,129,AAAAAAAAAAAAAA\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=45,13812345678,129,ABC',
        "match": 'AT\+CPBW=45,13812345678,129,ABC\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=46,18012345678,129,abc',
        "match": 'AT\+CPBW=46,18012345678,129,abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=47,666666,129,1A#',
        "match": 'AT\+CPBW=47,666666,129,1A#\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=48,88888888,129,1abc',
        "match": 'AT\+CPBW=48,88888888,129,1abc\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=49,00000000,129,1_a',
        "match": 'AT\+CPBW=49,00000000,129,1_a\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=50,11111111,129,luat',
        "match": 'AT\+CPBW=50,11111111,129,luat\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=1',
        "match": 'AT\+CPBW=1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBR=?',
        "match": 'AT\+CPBR=\?\s{4}\+CPBR: \(\d-\d+\),\d+,\d+\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBR=1',
        "match": 'AT\+CPBR=1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBR=1,3',
        "match": 'AT\+CPBR=1,3\s{4}\+CPBR: 2,"12345678901234567890",129,"12345678901234"\s{2}\+CPBR: 3,"1234567890",129,"1234567"\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBR=50',
        "match": 'AT\+CPBR=50\s{4}\+CPBR: 50,"11111111",129,"luat"\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBF=?',
        "match": 'AT\+CPBF=\?\s{4}\+CPBF: \d+,\d+\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBF=AAAAAAAAAAAAAA',
        "match": 'AT\+CPBF=AAAAAAAAAAAAAA\s{4}\++CPBF: 4,"15012345678",129,"AAAAAAAAAAAAAA"\s{2}\+CPBF: 14,"15012345678",129,"AAAAAAAAAAAAAA"\s{2}\+CPBF: 24,"15012345678",129,"AAAAAAAAAAAAAA"\s{2}\+CPBF: 34,"15012345678",129,"AAAAAAAAAAAAAA"\s{2}\+CPBF: 44,"15012345678",129,"AAAAAAAAAAAAAA"\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CNUM=?',
        "match": 'AT\+CNUM=\?\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBS="ON"',
        "match": 'AT\+CPBS="ON"\s{4}\+CPBS: "ON",\d,\d\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CPBW=1,"+18812345678",145',
        "match": 'AT\+CPBW=1,"\+18812345678",145\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CNUM',
        "match": 'AT\+CNUM\s{4}\+CNUM: "","\+18812345678",145\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
]
